// pages/test/test.js
import instance from '../../utils/http'
import { reqSwiperData } from '../../api/index'


Page({
  // ------测试并发请求---------------
  async allHandler() {
    const res = await reqSwiperData()

    //  await instance.get('/index/findBanner')
    //  await instance.get('/index/findCategory1')
    //  await instance.get('/index/findBanner')
    //  await instance.get('/index/findCategory1')

    // await Promise.all([instance.get('/index/findBanner'),instance.get('/index/findCategory1'),instance.get('/index/findBanner'),instance.get('/index/findCategory1')])
// -----------------------------------
    // const res = await instance.get('/index/findBanner')
    // const res = await instance.get('/cart/getCartList').catch((err)=>{
    //   console.log(err);
    //   return err
    // })

    // const res = await instance.get('/index/findBanner111').catch((err)=>{
    //   console.log(err);
    //   return err
    // })

// -------------------------------------------------------------
    // const res = await instance.all(
    //   instance.get('/index/findBanner'),
    //   instance.get('/index/findCategory1'),
    //   instance.get('/index/findBanner')
    // )
    console.log(res);

  }
})